
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript"
	src="/system/libraries/javascript/jquery-1.7.2.js"></script>
<script type="text/javascript">
		$(document).ready(function() {
			$("#login_form").submit(function() {
				var unameval = $("#username").val();
				var pwordval = $("#password").val();
				var actionVal = 'login';
				var url = $("#url").val();
				$.post(url+'login/doLogin', { username: unameval,
				password: pwordval,action: actionVal }, function(data) {
					if (data.redirect=='1') {
						window.location.replace(url+'welcome');
					} else {
						$("#status_username").html(data.username);
						$("#status_password").html(data.password);
					}
				},'json');
				return false;
			});
		});
	</script>
</head>
<body>
	
	<form id="login_form" method="post">
		<div id="user_input">
			Username: <input type="text" id="username" />
			<div id="status_username" style="display: inline;color: red;"></div>
		</div>
		<br>
		<div id="password_input">
			Password: <input type="text" id="password" />
			<div id="status_password" style="display: inline;color: red;"></div>
		</div>
				<input type="hidden" id=url value="<?= $base ?>">
		<br> <input type="submit" value="Login" />
	</form>
	<p>
		Not logged in? <a href="<?= $base ?>login/register">Register</a>
	</p>
</body>
</html>
